﻿@model PagedList.IPagedList<BB.Apostas.Models.Jornada>
<h2>Apostar</h2>
@if (Model != null)
{
    <h4>Competicao Activa: <strong>@ViewBag.Active</strong></h4>    
    <table>
        <tr>
            <th>Id
            </th>
            <th>Nome
            </th>
            <th>Realizado
            </th>
            <th></th>
        </tr>
        @{           
    foreach (var item in Model)
    {
            <tr>
                <td>
                    @Html.DisplayFor(modelitem => item.Id)
                </td>
                <td>
                    @Html.DisplayFor(modelitem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelitem => item.Fulfilled)
                </td>
                <td>
                    @if (item.Fulfilled)
                    {
                        @Html.ActionLink("Ver", "Edit", new { id = item.Id })
                    }
                    else
                    {
                        @Html.ActionLink("Apostar", "Edit", new { id = item.Id })
                    }
                </td>
            </tr>
    }        
        }
        <tfoot>
            <tr>
                <td colspan="4">
                    @Html.Partial("_PagingPartial")
                </td>
            </tr>
        </tfoot>
    </table>
}
else
{
    <h3>Nao ha competicoes activas.
    </h3>
}
